package com.elsa.common.entity;

import java.util.HashMap;

/**
 * @projectName：elsa-common
 * @typeName：ElsaResponse
 * @author：cos
 * @date：2021年5月7日
 * @version
 * @desc：系统的统一响应格式
 */
public class ElsaResponse extends HashMap<String, Object> {

    private static final long serialVersionUID = -8713837118340960775L;

    public ElsaResponse message(String message) {
        this.put("message", message);
        return this;
    }

    public ElsaResponse data(Object data) {
        this.put("data", data);
        return this;
    }

    @Override
    public ElsaResponse put(String key, Object value) {
        super.put(key, value);
        return this;
    }

    public String getMessage() {
        return String.valueOf(get("message"));
    }

    public Object getData() {
        return get("data");
    }
}
